package com.flower.service.impl;

import com.flower.rpc.UserService;
import com.flower.rpc.bean.User;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Override
    public User get(Long id) {
        User user = new User();
        user.setUsername(id + "-get-username");
        user.setPassword(id + "-get-password");
        System.err.print(user);
        return user;
    }

    @Override
    public User byJson(User user) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public User byForm(Long id, String username) {
        User user = new User();
        user.setUsername(id + "-byForm-" + username);
        user.setPassword(id + "-byForm-password");
        System.err.print(user);
        return user;
    }

    @Override
    public User byQuery(String username, String password) {
        User user = new User();
        user.setUsername("byQuery-" + username);
        user.setPassword("byQuery-" + password);
        System.err.print(user);
        return user;
    }

}
